<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    392. Is Subsequence
   </h1>
   <p>
    Given a string
    <b>
     s
    </b>
    and a string
    <b>
     t
    </b>
    , check if
    <b>
     s
    </b>
    is subsequence of
    <b>
     t
    </b>
    .
   </p>
   <p>
    You may assume that there is only lower case English letters in both
    <b>
     s
    </b>
    and
    <b>
     t
    </b>
    .
    <b>
     t
    </b>
    is potentially a very long (length ~= 500,000) string, and
    <b>
     s
    </b>
    is a short string (&lt;=100).
   </p>
   <p>
    A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie,
    <code>
     "ace"
    </code>
    is a subsequence of
    <code>
     "abcde"
    </code>
    while
    <code>
     "aec"
    </code>
    is not).
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
    <b>
     s
    </b>
    =
    <code>
     "abc"
    </code>
    ,
    <b>
     t
    </b>
    =
    <code>
     "ahbgdc"
    </code>
   </p>
   <p>
    Return
    <code>
     true
    </code>
    .
   </p>
   <p>
    <b>
     Example 2:
    </b>
    <br>
    <b>
     s
    </b>
    =
    <code>
     "axc"
    </code>
    ,
    <b>
     t
    </b>
    =
    <code>
     "ahbgdc"
    </code>
   </p>
   <p>
    Return
    <code>
     false
    </code>
    .
   </p>
   <p>
    <b>
     Follow up:
    </b>
    <br>
    If there are lots of incoming S, say S1, S2, ... , Sk where k &gt;= 1B, and you want to check one by one to see if T has its subsequence. In this scenario, how would you change your code?
   </p>
   <p>
    <b>
     Credits:
    </b>
    <br>
    Special thanks to
    <a href="https://leetcode.com/pbrother/">
     @pbrother
    </a>
    for adding this problem and creating all test cases.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    392. 判断子序列
   </h1>
   <p>
    给定字符串
    <strong>
     s
    </strong>
    和
    <strong>
     t
    </strong>
    ，判断
    <strong>
     s
    </strong>
    是否为
    <strong>
     t
    </strong>
    的子序列。
   </p>
   <p>
    你可以认为
    <strong>
     s
    </strong>
    和
    <strong>
     t
    </strong>
    中仅包含英文小写字母。字符串
    <strong>
     t
    </strong>
    可能会很长（长度 ~= 500,000），而
    <strong>
     s
    </strong>
    是个短字符串（长度 &lt;=100）。
   </p>
   <p>
    字符串的一个子序列是原始字符串删除一些（也可以不删除）字符而不改变剩余字符相对位置形成的新字符串。（例如，
    <code>
     "ace"
    </code>
    是
    <code>
     "abcde"
    </code>
    的一个子序列，而
    <code>
     "aec"
    </code>
    不是）。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
    <br>
    <strong>
     s
    </strong>
    =
    <code>
     "abc"
    </code>
    ,
    <strong>
     t
    </strong>
    =
    <code>
     "ahbgdc"
    </code>
   </p>
   <p>
    返回&nbsp;
    <code>
     true
    </code>
    .
   </p>
   <p>
    <strong>
     示例&nbsp;2:
    </strong>
    <br>
    <strong>
     s
    </strong>
    =
    <code>
     "axc"
    </code>
    ,
    <strong>
     t
    </strong>
    =
    <code>
     "ahbgdc"
    </code>
   </p>
   <p>
    返回&nbsp;
    <code>
     false
    </code>
    .
   </p>
   <p>
    <strong>
     后续挑战
    </strong>
    <strong>
     :
    </strong>
   </p>
   <p>
    如果有大量输入的 S，称作S1, S2, ... , Sk 其中 k &gt;= 10亿，你需要依次检查它们是否为 T 的子序列。在这种情况下，你会怎样改变代码？
   </p>
   <p>
    <strong>
     致谢:
    </strong>
   </p>
   <p>
    特别感谢
    <strong>
    </strong>
    <a href="https://leetcode.com/pbrother/">
     @pbrother&nbsp;
    </a>
    添加此问题并且创建所有测试用例。
   </p>
  </div>
 </body>
</html>